#pragma once
#ifndef __LIT__NAME__MODIFIER__HH__
#define __LIT__NAME__MODIFIER__HH__

#include <LitPrerequisites.h>
#include <LitString.h>
#include <unordered_map>

namespace Lit
{
	struct LIT_API NameModifier
	{
		static const NameModifier Blank;
		static const NameModifier FilePath;

		String prefix;
		String suffix;
		String link;

		std::unordered_map<String,String> replaces;

		NameModifier( const String &prefix_ = "", const String &suffix_ = "", const String &link_ = "_" );
		NameModifier( const NameModifier& rk );
		NameModifier& operator=( const NameModifier& rk );
		~NameModifier( );
				
		bool operator==( const NameModifier& rk ) const;
		bool operator!=( const NameModifier& rk ) const;
				
		// treats whole string in what as a replacer
		NameModifier& setReplace( const String &what, const String &by = "" );
		// treats each letters in (what) as a different replacer, 
		// but replace what[i] with whole string in (by)
		NameModifier& setReplaceArray( const String &what, const String &by = "" );

		String replace( const String &source ) const;
		String operator()( const String &name, bool keep_empty_parts = false ) const;
		String generate( const String &name, bool keep_empty_parts = false ) const;
	};
};

#endif